package com.chencs.app.product.service;

import com.chencs.vo.net.request.*;
import com.chencs.webmvc.rest.RestFullTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Created by Administrator on 2017/10/10.
 */
@Service
public class AppProductService {



    @Autowired
    RestFullTemplate restTemplate;
    private static final String URLPATH = "service-common/app/product/";


    /**getProduct
     * 获取商品詳情
     * @return
     */
    public String findProduct(ProductRequest request){
        String ret = restTemplate.postForObject(URLPATH + "findProduct", String.class,request);
        return ret;

    }

    public String getProductList( ProductListRequest request){
        String ret = restTemplate.postForObject(URLPATH + "getProductList", String.class,request);
        return ret;

    }

    /**
     * 相似商品
     * @return
     */
    public String getSimilarProductList( ProductRequest  request){
        String ret = restTemplate.postForObject(URLPATH + "getSimilarProductList", String.class,request);
        return ret;

    }


    /**
     * @return
     */
    public String getParityProductList( ProductRequest  request){
        String ret = restTemplate.postForObject(URLPATH + "getParityProductList", String.class,request);
        return ret;

    }


    //top榜单
    /**
     * @return
     */
    public String topList( PushRequest request){
        String ret = restTemplate.postForObject(URLPATH + "topList", String.class,request);
        return ret;

    }

    /**
     * @return
     */
    public String dayUpdate( PushRequest  request){
        String ret = restTemplate.postForObject(URLPATH + "dayUpdate", String.class,request);
        return ret;

    }



    /**
     * @return
     */
    public String getJHSList( ProductRequest request){
        String ret = restTemplate.postForObject(URLPATH + "getJHSList", String.class,request);
        return ret;
    }


    /**
     * @return
     */
    public String getjhsItem( RequestBase request){
        String ret = restTemplate.postForObject(URLPATH + "getjhsItem", String.class,request);
        return ret;
    }


    /**
     * @return
     */
    public String getCommand( ProductRequest request){
        String ret = restTemplate.postForObject(URLPATH + "getCommand", String.class,request);
        return ret;

    }
    /**
     * @return
     */
    public String applyCommission( ApplyCommissionRequest request){
        String ret = restTemplate.postForObject(URLPATH + "applyCommission", String.class,request);
        return ret;

    }

}
